$(function () {

    $(".car_tab .deletecar").live("click",function () {
        var id = $(this).parent().find(".shanchu").val();
        $.getJSON("easybuy/Car/delete",
            {"id":id,"userName":userName},
            function (data) {
                if (data){
                    alert("购物车移除成功！");
                    xianshi();
                    car();
                }else {
                    alert("购物车移除失败！");
                }
            });
    });

    $(".car_tab .r_txt a").live("click",function () {
        $.getJSON("easybuy/Car/deleteAll",
            {"userName":userName},
            function (data) {
                if (data){
                    alert("清除购物车成功！");
                    xianshi();
                    car();
                }else {
                    alert("购物车移除失败！");
                }
            });
    });
});